package enumeration;

/**
 * Created with IntelliJ IDEA
 * Description:自定义枚举
 * User:22954
 * Date:2024-01-26
 * Time:3:42
 */
public class Season {
    /**
     * 1.私有化类变量名和构造方法
     * 2.创建常量静态对象
     * 注意:不要设置setting方法
     *     枚举对象名一般全部大写
     */
    private String name;//季节名
    private String desc;//季节描述

    public static final Season SPRING = new Season("Spring", "warm");
    public static final Season SUMMER = new Season("Summer", "hot");
    public static final Season AUTUMN = new Season("Autumn", "cool");
    public static final Season WINTER = new Season("Winter", "cold");

    private Season(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "Season{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}
